package com.math.aistudykbr.utils;

/**
 * 用户上下文
 */
public class UserContext {

    private static final ThreadLocal<Long> userContext = new ThreadLocal<>();

    public static Long getUser() {
        return userContext.get();
    }

    public static void setUser(Long userId) {
        UserContext.userContext.set(userId);
    }

    public static void remove() {
        UserContext.userContext.remove();
    }
}
